<script setup lang="ts">
import {reactive} from 'vue';
import {useRouter} from 'vue-router';
import {getCompany} from "@/api/company"
import CompanySource from './components/CompanySource.vue'
import CompanyTask from './components/CompanyTask.vue'
import {Toast} from 'vant';

const router = useRouter()
const companyId = router.currentRoute.value.params.id
const state: any = reactive({
  item: '',
  jobsList: [],
  loading: false
})
const leftBack = () => history.back();
const gotoMessage = () => {
  router.push('/message/talk/' + state.item.user_id)
}
const getCompanyAllList = async () => {
  state.loading = true
  getCompany(companyId).then(res => {
    console.log(res)
    state.item = res.data.nmzpCompany
    state.jobsList = res.data.nmzpJobList
    state.loading = false;
  })
}
getCompanyAllList()
</script>
<template>
  <van-nav-bar title="任务来源" left-arrow @click-left="leftBack"/>
  <CompanySource :item="state.item"></CompanySource>
  <CompanyTask :jobsList="state.jobsList"></CompanyTask>
</template>
<style scoped>

</style>